<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateThesisTopicsTable extends Migration
{
    public function up()
    {
        Schema::create('thesis_topics', function (Blueprint $table) {
            $table->id();
            $table->foreignId('teacher_id')->constrained()->onDelete('cascade');
            $table->string('title', 255);
            $table->text('description');
            $table->text('requirements');
            $table->integer('max_students')->default(1);
            $table->integer('current_students')->default(0);
            $table->enum('status', ['open', 'closed'])->default('open');
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('thesis_topics');
    }
} 